package com.minsf.rpc.proxy;

import java.lang.reflect.Proxy;

/**
 * @Description 服务代理工厂
 * @Author minify
 * @Date 2024/3/24 17:30
 * @Project sf-rpc
 */
public class ServiceProxyFactory {

    public static <T> T getProxy(Class<T> serviceClass) {
        return (T) Proxy.newProxyInstance(
                serviceClass.getClassLoader(),
                new Class[]{serviceClass},
                new ServiceProxy());
    }
}
